package com.zhiche.lisa.oms.service;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.IService;
import com.zhiche.lisa.oms.dao.model.Order;
import com.zhiche.lisa.oms.dao.model.OrderItem;
import com.zhiche.lisa.oms.dao.model.bo.ShippingInfoBO;
import com.zhiche.lisa.oms.dto.LisaFeeReceivable;
import com.zhiche.lisa.oms.vo.OrderVO;
import com.zhiche.lisa.oms.vo.ShipmentInfoVO;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 订单 服务类
 * </p>
 *
 * @author qichao
 * @since 2018-06-18
 */
public interface IOrderService extends IService<Order> {

    /**
     * 获取已经认证过的牵引车车牌
     */
    void getAuthedCarrierPlate();

    /**
     * 根据车牌号查找ERP的调度指令并生成订单
     *
     * @return
     */
    void createOrderByErpShipment(String authorization, List<String> plateList, Long teanantId);

    /**
     * 创建订单
     *
     * @param shippingInfoBO
     */
    void createOrder(String authorization, ShippingInfoBO shippingInfoBO, Long teanantId);

    /**
     * 添加订单
     *
     * @param shipmentInfoVO
     */
    void addOrder(ShipmentInfoVO shipmentInfoVO, String authorization);


    /**
     * 模拟登陆获取token
     */
    Boolean loginWithOutToken(ShipmentInfoVO shipmentInfoVO);


    /**
     * 根据id查询订单信息
     *
     * @param id
     */
    Order queryOrderById(Long id);


//    Order queryOrder(Map<String, String> condition);

    /**
     * OMS获取应收账款信息
     */
    Map<String, LisaFeeReceivable> queryFeeReceivableOms(List<String> wayBillDtlIds);

    /**
     * 为TMS提供接口,根据shipOrderCode 查询order及指令号
     */
    Order queryOrderFromTms(Map<String, String> params);

    void insertPriceIncoming(ShipmentInfoVO shipmentInfo,
                             Order order,
                             OrderVO orderVO,
                             OrderItem orderItem,
                             Long serviceTypeId, String authorization);

    Long getTransTypeId(String serviceTypeName);

    int selectCountNotenant(EntityWrapper<Order> orderEW);

    Order selectOneNotenant(EntityWrapper<Order> ew);

    void getErpDispatch(String plateNo, String authorization, String tenantId);

    /**
     *  空放指令添加订单
     * @param infoDTO 指令接收对象
     * @param token token
     */
    void addEmptyOrder(ShipmentInfoVO infoDTO, String token);
}
